package com.example.demo.client.vm.cssmqry.menu;

import com.ffcs.oss.common.utils.tree.TreeFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.ibatis.type.Alias;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @Desc
 * @Author zhengmf
 * @Date 2019-12-27 17:52:03
 */
@Alias("MenuTreeVm")
@ApiModel
public class MenuTreeVm implements TreeFormat<MenuTreeVm, Long>, Serializable {
    private static final long serialVersionUID = 6793546659111644169L;
    @ApiModelProperty("菜单id")
    private Long id;
    @ApiModelProperty("菜单名称")
    private String nameCn;
    @ApiModelProperty("父菜单名称")
    private String parentNameCn;

    @ApiModelProperty("菜单编码")
    private String nameEn;

    @ApiModelProperty("菜单父id")
    private Long parentId;

    @ApiModelProperty("url")
    private String url;

    @ApiModelProperty("排序号")
    private Long menuIndex;

    @ApiModelProperty("菜单图标url")
    private String imageUrl;

    @ApiModelProperty("菜单类型")
    private String menuType;

    @ApiModelProperty("菜单描述")
    private String menuDesc;

    @ApiModelProperty("权限码")
    private String permissionCode;

    @ApiModelProperty("菜单全量id")
    private String fullMenuId;

    @ApiModelProperty("是否启用")
    private String enabled;

    @ApiModelProperty("子元素")
    private List<MenuTreeVm> children;

    @Override
    public Long getTreeFormatId() {
        return this.id;
    }

    @Override
    public Long getParentTreeFormatId() {
        return this.parentId;
    }

    @Override
    public void addChildren(MenuTreeVm children) {
        if(this.children == null){
            this.children = new ArrayList<>();
        }
        this.children.add(children);
    }

    public void setId(Long id) {
        this.id = id;
    }

    public void setNameCn(String nameCn) {
        this.nameCn = nameCn;
    }

    public void setNameEn(String nameEn) {
        this.nameEn = nameEn;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public void setMenuIndex(Long menuIndex) {
        this.menuIndex = menuIndex;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public void setMenuType(String menuType) {
        this.menuType = menuType;
    }

    public void setMenuDesc(String menuDesc) {
        this.menuDesc = menuDesc;
    }

    public void setPermissionCode(String permissionCode) {
        this.permissionCode = permissionCode;
    }

    public void setFullMenuId(String fullMenuId) {
        this.fullMenuId = fullMenuId;
    }

    public void setEnabled(String enabled) {
        this.enabled = enabled;
    }

    public List<MenuTreeVm> getChildren() {
        return children;
    }

    public void setChildren(List<MenuTreeVm> children) {
        this.children = children;
    }

    public Long getId() {
        return id;
    }

    public String getNameCn() {
        return nameCn;
    }

    public String getNameEn() {
        return nameEn;
    }

    public Long getParentId() {
        return parentId;
    }

    public String getUrl() {
        return url;
    }

    public Long getMenuIndex() {
        return menuIndex;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public String getMenuType() {
        return menuType;
    }

    public String getMenuDesc() {
        return menuDesc;
    }

    public String getPermissionCode() {
        return permissionCode;
    }

    public String getFullMenuId() {
        return fullMenuId;
    }

    public String getEnabled() {
        return enabled;
    }

    public String getParentNameCn() {
        return parentNameCn;
    }

    public void setParentNameCn(String parentNameCn) {
        this.parentNameCn = parentNameCn;
    }

    @Override
    public String toString() {
        return "MenuTreeVm{" +
            "id=" + id +
            ", nameCn='" + nameCn + '\'' +
            ", parentNameCn='" + parentNameCn + '\'' +
            ", nameEn='" + nameEn + '\'' +
            ", parentId=" + parentId +
            ", url='" + url + '\'' +
            ", menuIndex=" + menuIndex +
            ", imageUrl='" + imageUrl + '\'' +
            ", menuType='" + menuType + '\'' +
            ", menuDesc='" + menuDesc + '\'' +
            ", permissionCode='" + permissionCode + '\'' +
            ", fullMenuId='" + fullMenuId + '\'' +
            ", enabled='" + enabled + '\'' +
            ", children=" + children +
            '}';
    }
}
